pub trait DoRouter {

    fn parse(&self, str: String) -> Self;

    fn execute(&mut self);
}

#[derive(Default)]
pub struct LoginRouter {
    pub login: Login,
    pub output: Option<LoginResp>,
}

#[derive(Debug, Default)]
pub struct Login {

}

impl DoRouter for LoginRouter {
    fn parse(&self, str: String) -> Self {
        todo!()
    }

    fn execute(&mut self) {
        todo!()
    }
}

#[derive(Debug, Default)]
pub struct LoginResp {

}

#[derive(Debug, Default)]
pub struct TokenLoginRouter;

#[derive(Debug, Default)]
pub struct TokenLogin {

}

impl DoRouter for TokenLoginRouter {
    fn parse(&self, str: String) -> Self {
        todo!()
    }

    fn execute(&mut self) {
        todo!()
    }
}

#[test]
fn route2() {
    // let mut router_map : HashMap<&str, Box<dyn DoRouter>> = HashMap::new();

    // router_map.insert("receiveMessage", Box::new(LoginRouter::default()));
    // router_map.insert("readMessage", Box::new(TokenLoginRouter::default()));
    //
    // let router = router_map.get("receiveMessage").unwrap();
    // let mut t = router.parse("sss");
    // t.execute();
}